package com.beehoo.dcportal.dao.impl;

import java.sql.SQLException;

import org.apache.log4j.Logger;

import com.beehoo.dcportal.common.base.BaseDao;
import com.beehoo.dcportal.common.base.BaseException;
import com.beehoo.dcportal.dao.ILogDao;
import com.beehoo.dcportal.model.LogBean;

public class LogDaoImpl extends BaseDao implements ILogDao {
	private static final Logger logger = Logger.getLogger(LogDaoImpl.class);
	
	/**
	 * 记录日志
	 * @param logBean
	 * @throws BaseException
	 */
	public void insertLog(LogBean logBean) throws BaseException{
		try {
			getSqlMapClient().insert("Common.insertLog", logBean);
		} catch (SQLException e) {
			logger.error(logBean.getFunction()+logBean.getContent());
			throw new BaseException(e,"插入"+logBean.getFunction()+"业务日志失败");
		}
	}
}
